package com.linc.multithread.utils.BlockDetect;

import android.os.Looper;
import android.util.Printer;

public class BlockDetectByPrinter {
    private static final String START = ">>>>> Dispatching";
    private static final String END = "<<<<< Finished";

    public static void start(){
        Looper.getMainLooper().setMessageLogging(new Printer() {
            @Override
            public void println(String x) {
                if(x.startsWith(START)){
                    LogMonitor.getsInstance().startMonitor();
                }
                if(x.startsWith(END)){
                    LogMonitor.getsInstance().startMonitor();
                }
            }
        });
    }

}
